#include<func.h>
//获得进程组id
int main()
{
    if(!fork())
    {
        printf("I am child,pid=%d,ppid=%d,pgid=%d\n",getpid(),getppid(),getpgid(0));
        while(1);
        return 0;
    }
    else{
        printf("I am father,pid=%d,ppid=%d,pgid=%d\n",getpid(),getppid(),getpgid(0));
        while(1);
        return 0;
    }
}